//
//  MinroadOauth.h
//  Oauth
//
//  Created by gao wei on 10-8-10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "OADataFetcher.h"
#import "KEY.h"
#import "DBLoginViewController.h"
#import "DBDoubanApi.h"

@protocol OauthToken

- (void)OauthDidFinish:(OAToken *)token;
- (void)infoGetSuccess:(NSData*)data;

@end


@interface MinroadOauth : NSObject 
<DBLoginDelegate, DBDoubanApiDelegate>{
	OAConsumer *consumer;
	OAMutableURLRequest *hmacSha1Request;//请求授权
	OAMutableURLRequest *hmacSha1Request1;//请求access
	OAToken *token;
	OAHMAC_SHA1SignatureProvider *hmacSha1Provider;
	
    NSString *appKey, *appSecret;
	id<OauthToken> delegate;
    UIViewController *viewController;
    
    DBDoubanApi *api;
}

@property (nonatomic, readonly) OAToken *token;
@property (assign,nonatomic) id<OauthToken> delegate;
@property (nonatomic, retain) NSString *appKey, *appSecret;
@property (nonatomic, assign) UIViewController *viewController;

- (void)startOauth;
- (void)startAccessOauth;

- (void)getUserInfo;

@end
